import request from '@/utils/request.js'

// 常量
const api_name = '/admin/product'

export default {
    getProductPage(params) {
        return request({
            url: `${api_name}/getProductPage`,
            method: 'get',
            params: params
        })
    },
    getProductDetailsById(id) {
        return request({
            url: `${api_name}/getProductDetailsById/${id}`,
            method: 'get'
        })
    },
    saveProduct(data) {
        return request({
            url: `${api_name}/saveProduct`,
            method: 'post',
            data: data
        })
    },
    updateProduct(data) {
        return request({
            url: `${api_name}/updateProduct`,
            method: 'post',
            data: data
        })
    },
    batchDeleteByIds(ids) {
        return request({
            url: `${api_name}/batchDeleteByIds`,
            method: 'post',
            data: ids
        })
    },
    updateStatusById(id,params) {
        return request({
            url: `${api_name}/updateStatusById/${id}`,
            method: 'post',
            params: params
        })
    },
}
